POV-Ray : Newsgroups : povray.binaries.images : A couple of isosurfaces : Re: A couple of isosurfaces Server Time
1 Jun 2024 15:04:40 EDT (-0400)
  Re: A couple of isosurfaces  
From: Tek
Date: 12 Jul 2010 17:48:59
Message: <4c3b8dcb$1@news.povray.org>
Doh! Sorry yeah they're macros of mine:

#macro Flip() colour_map { [0 rgb 1][1 rgb 0] } #end

#declare SphereAngleDistribute = function(x) { asin(x)/(pi/2) }
#macro SphereRand(Seed) vrotate( z, 
<90*SphereAngleDistribute(rand(Seed)*2-1),360*rand(Seed)> ) #end

-- 
Tek
http://evilsuperbrain.com


"Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote in message 
news:4c3977e9$1@news.povray.org...
> Flip() and SphereRand() are not defined. Are they macros of yours? I 
> cannot find them in any includes, although I can imagine what they should 
> look like...
>
> Thomas
>
> "Tek" <tek### [at] evilsuperbraincom> schreef in bericht 
> news:web.4c36e0afe5fe6399caa39c860@news.povray.org...
>> Ok the source for both objects is pretty small, so I'll just drop it in
>> here:
>> //------Concrete with Rebar------
>>
>> #macro DecayBlob(Pos)
>> isosurface {
>>  #local Off = VRand(rs)*100;
>>  #local f_Hole =
>>   function { pigment {
>>    average
>>    pigment_map {
>>     [1 spherical scale 2 cubic_wave translate Off warp { turbulence .5 
>> octaves
>> 3 } translate -Off]
>>     [1 pigment_pattern { granite translate Off scale 5 Flip() } poly_wave 
>> 2]
>>     [.4
>>      pigment_pattern {
>>       #local f = function { 
>> 1-sqrt(min(min(x*x+y*y,x*x+z*z),y*y+z*z))/sqrt(2) }
>>       function { min(1,max(0,f(sin(x)*4,sin(y)*4,sin(z*4))*5-3)) }
>>       cubic_wave
>>       scale 1/pi
>>       translate .5
>>       scale .8
>>       warp { turbulence .2 octaves 3 }
>>      }
>>      Flip()
>>      translate -Pos // so they line up in different holes
>>     ]
>>    }
>>   } }
>>  function {
>>   1-2*f_Hole(x,y,z).x
>>  }
>>  max_gradient 8
>>  all_intersections
>>  contained_by { sphere { 0, 2 } }
>>  scale .5
>>  translate Pos
>> }
>> #end
>>
>> difference {
>> superellipsoid { <.1,.1> normal { granite .2 accuracy 1/1000 } }
>> #local rs = seed(7);
>> #local i=0; #while ( i < 5 )
>>  #local Norm = <0,0,0>;
>>  #local Pos = SphereRand(rs);
>>  #local Pos = trace( Thobject, Pos*2,-Pos, Norm );
>>  #if ( vlength(Norm) > 0 )
>>   DecayBlob(Pos)
>>   #local i=i+1;
>>  #end
>> #end
>> }
>>
>>
>>
>>
>>
>>
>>
>
>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.